package com.zxy.shaozhiyi1.util.excel;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.RandomAccessFile;
 
public class AppendFile {
     
    public static void method1(String file, String conent) {   
        BufferedWriter out = null;   
        try {   
            out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, true)));   
            out.write(conent);   
        } catch (Exception e) {   
            e.printStackTrace();   
        } finally {   
            try {   
                if(out != null){
                    out.close();   
                }
            } catch (IOException e) {   
                e.printStackTrace();   
            }   
        }   
    }   
    
    
    public static void main(String[] args) {
    	File file = new File("d:" + File.separator + "1111111111111.txt") ;    // 声明File对象
    	AppendFile.method1("d:" + File.separator + "1111111111111.txt", "hahahah---");
    	AppendFile.method1("d:" + File.separator + "1111111111111.txt", "aaaaaaaaaaaaaaaaaaaaaa---");
	}
}